﻿using System;
using System.Data;
using Insifo.WE;

public partial class segSalir : ObjectPage
{
    /// <summary>
    /// Carga la Pagina
    /// </summary> 
    /// <returns></returns>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            Response.AddHeader("Pragma", "no-cache");
            Response.AddHeader("Pragma", "no-store");
            Response.AddHeader("cache-control", "no-cache");
            Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
            Response.Cache.SetNoStore();
            Cargar();

        }
    }

    protected void Cargar()
    {
        Salir();
        Response.Redirect("~/seg/segAcceso.aspx", true);
    }

    protected void Salir()
    {
        Session.Clear();
        Session.Abandon();
        EliminaCookies();

    }

    protected void EliminaCookies()
    {
        string[] cookies = Request.Cookies.AllKeys;
        foreach (string cookie in cookies)
        {
            Response.Cookies[cookie].Expires = DateTime.Now.AddDays(-1);
        }
    }
}